<div class="container">

  <%= form_for(@podcast_episode) do |f| %>
    <% if @podcast_episode.errors.any? %>
      <div id="error_explanation">
        <h2><%= pluralize(@podcast_episode.errors.count, "error") %> prohibited this article from being saved:</h2>

        <ul>
        <% @podcast_episode.errors.full_messages.each do |message| %>
          <li><%= message %></li>
        <% end %>
        </ul>
      </div>
    <% end %>

    <div class="field">
      <%= f.label :title %><br>
      <%= f.text_field :title, autocomplete: "off" %>
    </div>
    <div class="field">
      <%= f.label :quote %><br>
      <%= f.text_field :quote, autocomplete: "off" %>
    </div>
    <div class="field">
      <%= f.label :remote_image_url, "Paste Image URL" %><br>
      <%= f.text_field :remote_image_url, autocomplete: "off" %>
    </div>
    <div class="field">
      <%= f.label :image, "Or Upload Image" %><br>
      <%= f.file_field :image %>
    </div>
    <% if @podcast_episode.image %>
      <div class="field" style="text-align:center;margin-top:30px;">
        <%= image_tag @podcast_episode.image_url, width: 398, style: "border-radius:500px;height:auto;max-width:70%;" %>
      </div>
    <% end %>
    <div class="field">
      <%= f.label :remote_social_image_url, "Paste Social Media Image URL" %><br>
      <%= f.text_field :remote_social_image_url, autocomplete: "off" %>
    </div>
    <div class="field">
      <%= f.label :social_image, "Or Upload Image" %><br>
      <%= f.file_field :social_image %>
    </div>
    <% if @podcast_episode.social_image %>
      <div class="field" style="text-align:center;margin-top:30px;">
        <%= image_tag @podcast_episode.social_image_url, width: 398, style: "height:auto;max-width:70%;" %>
      </div>
    <% end %>

    <div class="field">
      <br/>
      <%= f.text_area :body %>
    </div>

    <div class="actions">
      <%= f.submit "Save Article" %>
    </div>
  <% end %>
  <%= render 'articles/tinymce' %>

</div>
